{$CLEO .cm}
{$NOSOURCE}

$ONMISSION = 1
0ADF: add_dynamic_GXT_entry "A9xBES" text "~r~New Best Score : ~1~ Second"
0ADF: add_dynamic_GXT_entry "A9xCou" text "Time_:_~1~_Millisecond"
0ADF: add_dynamic_GXT_entry "A9xFin" text "~r~Finish In ~1~ Second"
0ADF: add_dynamic_GXT_entry "A9xFi2" text "~w~Parkour Passed"
0ADF: add_dynamic_GXT_entry "AxFall" text "~r~You Fall From Parkour"
0ADF: add_dynamic_GXT_entry "A9xFa2" text "~r~Parkour Failed"
0223: set_actor $PLAYER_ACTOR health_to 36000000
wait 0
00BA: show_text_styled GXT "Kour_10" time 4000 style 2
0924: enable_screen_darkness 1 with_value 30
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 70
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 110
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 150
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 190
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 230
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 255
0@ = 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
01B6: set_weather 1
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 2562.842 -3657.5127 49.5073
0619: enable_actor $PLAYER_ACTOR collision_detection 0
Actor.Angle($PLAYER_ACTOR) = 270.000
02EB: restore_camera_with_jumpcut
:Object
wait 0
0247: load_model 356
0247: load_model 1684
0247: load_model 1876
if and
0248:   model 356 available
0248:   model 1684 available
0248:   model 1876 available
0248:   model 0 available
jf @Object
038B: load_requested_models
Jump @Next_Step
:Next_Step
01B2: give_actor $PLAYER_ACTOR weapon 31 ammo 99999
00BC: show_text_highpriority GXT 'RACE5' time 3000 flag 1
0924: enable_screen_darkness 1 with_value 230
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 190
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 150
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 110
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 70
0001: wait 0 ms
0924: enable_screen_darkness 1 with_value 30
0001: wait 0 ms
0924: enable_screen_darkness 0 with_value 0
0619: enable_actor $PLAYER_ACTOR collision_detection 1
////////////////////////////////////////////////////////////
0213: 10@ = create_pickup #INFO type 3 at 2577.5906 -3657.5696 50.2073
03DC: 11@ = create_marker_above_pickup 10@
018B: set_marker 11@ radar_mode 2
Marker.SetColor(11@,4)
gosub @Create_Object
gosub @Create_Pickup
:1
wait 0
gosub @Time_Count
gosub @Dead_Check
gosub @Busted_Check
gosub @Mission_Check
gosub @Fall_Check1
if
0214:   pickup 10@ picked_up
jf @1
jump @2D

:2D
0213: 10@ = create_pickup #INFO type 3 at 2591.8188 -3657.4434 50.2073
03DC: 11@ = create_marker_above_pickup 10@
018B: set_marker 11@ radar_mode 2
Marker.SetColor(11@,4)

:2
wait 0
gosub @Time_Count
gosub @Dead_Check
gosub @Busted_Check
gosub @Mission_Check
gosub @Fall_Check1
if
0214:   pickup 10@ picked_up
jf @2
jump @3D

:3D
0213: 10@ = create_pickup #INFO type 3 at 2609.1479 -3657.5276 51.2073
03DC: 11@ = create_marker_above_pickup 10@
018B: set_marker 11@ radar_mode 2
Marker.SetColor(11@,4)

:3
wait 0
gosub @Time_Count
gosub @Dead_Check
gosub @Busted_Check
gosub @Mission_Check
gosub @Fall_Check1
if
0214:   pickup 10@ picked_up
jf @3
jump @4D

:4D
0213: 10@ = create_pickup #INFO type 3 at 2635.3252 -3656.9751 12.9773
03DC: 11@ = create_marker_above_pickup 10@
018B: set_marker 11@ radar_mode 2
Marker.SetColor(11@,4)

:4
wait 0
gosub @Time_Count
gosub @Dead_Check
gosub @Busted_Check
gosub @Mission_Check
gosub @Fall_Check
if
0214:   pickup 10@ picked_up
jf @4
jump @5D

:5D
0213: 10@ = create_pickup #INFO type 3 at 2678.9136 -3657.0964 12.9773
03DC: 11@ = create_marker_above_pickup 10@
018B: set_marker 11@ radar_mode 2
Marker.SetColor(11@,4)

:5
wait 0
gosub @Time_Count
gosub @Dead_Check
gosub @Busted_Check
gosub @Mission_Check
gosub @Fall_Check
if
0214:   pickup 10@ picked_up
jf @5
jump @6D

:6D
0750: set_object 4@ visibility 1
0750: set_object 5@ visibility 1
0750: set_object 6@ visibility 1
0750: set_object 7@ visibility 1
0750: set_object 14@ visibility 1
0750: set_object 15@ visibility 1
0750: set_object 16@ visibility 1
0750: set_object 17@ visibility 1
0750: set_object 18@ visibility 1
0750: set_object 19@ visibility 1
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 2564.842 -3657.5127 49.5073
Actor.Angle($PLAYER_ACTOR) = 270.000
0213: 10@ = create_pickup #INFO type 3 at 2561.874 -3657.5005 50.2073
03DC: 11@ = create_marker_above_pickup 10@
018B: set_marker 11@ radar_mode 2
Marker.SetColor(11@,4)

:6
wait 0
gosub @Time_Count
gosub @Dead_Check
gosub @Busted_Check
gosub @Mission_Check
gosub @Fall_Check
gosub @Teleport
if
0214:   pickup 10@ picked_up
jf @6
jump @7D

:7D
jump @Finish
:Finish
01E3: show_text_1number_styled GXT 'A9xFi2' number 3 time 5000 style 1 
0394: play_music 1
0AF1: write_int 1 to_ini_file "CLEO\A9xParkour\Parkour3" section "No11"  key  "Pass"
0@ /= 1000 
0AF1: write_int 0@ to_ini_file "CLEO\A9xParkour\Parkour2" section "No10" key "Last" 
0AF0: 60@ = get_int_from_ini_file "CLEO\A9xParkour\Parkour2" section "No10" key "Time"
if
not 60@ == 0
jf @New_Score
if
802D:   0@ >= 60@
jf @Still_Best
:New_Score
0AF1: write_int 0@ to_ini_file "CLEO\A9xParkour\Parkour2" section "No10" key "Time" 
01E5: show_text_1number_Highpriority GXT 'A9xBES' number 0@ time 5000 flag 2
Jump @END
:Still_Best
01E5: show_text_1number_Highpriority GXT 'A9xFin' number 0@ time 5000 flag 2

:END
if
09D1:   pickup 10@ created
jf @Pickup_Pass
0215: destroy_pickup 10@
:Pickup_Pass
Gosub @Delete_Object
Gosub @Delete_Pickup
0249: release_model 1684
0249: release_model 1876
0924: enable_screen_darkness 0 with_value 0
$ONMISSION = 0
04BB: select_interior 0
0860: link_actor $PLAYER_ACTOR to_interior 0
01B6: set_weather 1
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 1772.9604 -1349.9167 14.7541
Actor.Angle($PLAYER_ACTOR) = 180.0
03F0: enable_text_draw 0
02EB: restore_camera_with_jumpcut
0A93: end_custom_thread

:Mission_Check
if
not $ONMISSION == 0
jf @Fail
return

:Dead_Check
if
not Actor.Dead($PLAYER_ACTOR)
jf @Fail
return

:Busted_Check
if
8741:   actor $PLAYER_ACTOR busted
jf @Fail
return

:Fall_Check
if
8965:   actor $PLAYER_ACTOR swimming
jf @Fail_Fall
return

:Fall_Check1
if
8965:   actor $PLAYER_ACTOR swimming
jf @Fail_Fall
return

:Fail_Fall
00BC: show_text_highpriority GXT 'AxFall' time 3000 flag 1
jump @Fail

:Fail
00BA: show_text_styled GXT 'A9xFa2' time 5000 style 1 
jump @END

:Teleport
if
80EC:   actor $PLAYER_ACTOR sphere 0 near_point 2678.7698 -3657.1262 radius 1.0 1.0
jf @Teleporting
return

:Teleporting
0362: remove_actor $PLAYER_ACTOR from_car_and_place_at 2564.842 -3657.5127 49.5073
Actor.Angle($PLAYER_ACTOR) = 270.000
return

:Create_Object
0107: 1@ = create_object 1684 at 2566.521 -3657.4553 46.1765
0177: set_object 1@ Z_angle_to 180.0
0107: 2@ = create_object 1876 at 2566.521 -3657.4553 49.1765
0177: set_object 2@ Z_angle_to 180.0
08D2: object 2@ scale_model 10.0
0107: 3@ = create_object 356 at 2566.521 -3663.4553 50.2073
0177: set_object 3@ Z_angle_to 0.0
08D2: object 3@ scale_model 10.0
0107: 4@ = create_object 1684 at 2577.842 -3657.5127 46.1765
0177: set_object 4@ Z_angle_to 0.0 
0750: set_object 4@ visibility 0
0107: 5@ = create_object 1684 at 2591.842 -3657.5127 46.1765
0177: set_object 5@ Z_angle_to 0.0   
0750: set_object 5@ visibility 0
0107: 6@ = create_object 1684 at 2597.842 -3666.5127 45.1765
0453: set_object 6@ XY_rotation 0.0 0.0 angle 0.0
0750: set_object 6@ visibility 0
0107: 7@ = create_object 1684 at 2609.3203 -3657.4829 46.1765
0453: set_object 7@ XY_rotation 0.0 0.0 angle 0.0
0750: set_object 7@ visibility 0

0107: 8@ = create_object 356 at 2577.842 -3657.5127 46.1765
0177: set_object 8@ Z_angle_to 0.0 
08D2: object 8@ scale_model 10.0
0107: 9@ = create_object 356 at 2591.842 -3657.5127 46.1765
0177: set_object 9@ Z_angle_to 0.0   
08D2: object 9@ scale_model 10.0
0107: 12@ = create_object 356 at 2597.842 -3666.5127 45.1765
08D2: object 12@ scale_model 10.0
0453: set_object 12@ XY_rotation 0.0 0.0 angle 0.0
0107: 13@ = create_object 356 at 2609.3203 -3657.4829 46.1765
0453: set_object 13@ XY_rotation 0.0 0.0 angle 0.0
08D2: object 13@ scale_model 10.0

0107: 14@ = create_object 1684 at 2600.5168 -3657.4326 50.2073
0453: set_object 14@ XY_rotation 0.0 90.0 angle 0.0
0750: set_object 14@ visibility 0

0107: 15@ = create_object 1684 at 2634.8042 -3657.0371 8.9465
0453: set_object 15@ XY_rotation 0.0 0.0 angle 0.0
038C: object 15@ scatter 0.0 0.0 -200.0
0750: set_object 15@ visibility 1

0107: 16@ = create_object 1684 at 2644.8042 -3657.0371 8.9465
0453: set_object 16@ XY_rotation 0.0 0.0 angle 0.0
0750: set_object 16@ visibility 0

0107: 17@ = create_object 1684 at 2654.8042 -3657.0371 8.9465
0453: set_object 17@ XY_rotation 0.0 0.0 angle 0.0
0750: set_object 17@ visibility 0

0107: 18@ = create_object 1684 at 2664.8042 -3657.0371 8.9465
0453: set_object 18@ XY_rotation 0.0 0.0 angle 0.0
0750: set_object 18@ visibility 0

0107: 19@ = create_object 1684 at 2678.8042 -3657.0371 8.9465
0453: set_object 19@ XY_rotation 0.0 0.0 angle 0.0
0750: set_object 19@ visibility 0

0107: 20@ = create_object 1876 at 2678.8042 -3657.0371 11.9465
0177: set_object 20@ Z_angle_to 180.0
08D2: object 20@ scale_model 10.0
return

:Delete_Object
Object.Destroy(1@)
Object.Destroy(2@)
Object.Destroy(3@)
Object.Destroy(4@)
Object.Destroy(5@)
Object.Destroy(6@)
Object.Destroy(7@)
Object.Destroy(8@)
Object.Destroy(9@)
Object.Destroy(15@)
Object.Destroy(12@)
Object.Destroy(13@)
Object.Destroy(14@)
Object.Destroy(15@)
Object.Destroy(16@)
Object.Destroy(17@)
Object.Destroy(18@)
Object.Destroy(19@)
Object.Destroy(20@)
return
                        
:Create_Pickup
032B: 500@ = create_weapon_pickup #NVGOGGLES group 3 ammo 1 at 1830.2623 -1357.5748 117.8296
return

:Delete_Pickup
if
09D1:   pickup 500@ created
jf @Pickup_Passs
0215: destroy_pickup 500@
:Pickup_Passs
return

:Time_Count 
0@ += 20
03F0: enable_text_draw 0
081C: draw_text_outline 1 RGBA 255 255 255 255
0349: set_text_draw_font 3 
033F: set_text_draw_letter_size 0.4 1.21                                             
0340: set_text_draw_RGBA 250 1 1 255   
045A: draw_text_1number 35.0 70.0 GXT 'A9xCou' number 0@
return

